/*
Copyright 2008, 2009 Joonas Lehtolahti

This file is part of Openfire-C.

Openfire-C is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Openfire-C is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with Openfire-C.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef _XFIREPACKETID_H_
#define _XFIREPACKETID_H_

#define XFPID_RAW 0xffff

/* XfirePacketID.h subpacket ID defines */

#define XFPIDP_IM_IM 0x0000
#define XFPIDP_IM_ACK 0x0001
#define XFPIDP_IM_P2P 0x0002
#define XFPIDP_IM_TYPING 0x0003

#define XFPIDP_DLPEER_INFO 0x3a9c
#define XFPIDP_DLPEER_FILES 0x3a9d
#define XFPIDP_DLPEER_STATUS 0x3a9e

#define XFPIDP_GC_JOIN 0x4cf4
#define XFPIDP_GC_LEAVE 0x4cf5
#define XFPIDP_GC_MESSAGE 0x4cf6
/*#define XFPIDP_GC_UPDATE 0x4cf7*/
#define XFPIDP_GC_CNAME 0x4cf8
#define XFPIDP_GC_CLVL 0x4cf9
#define XFPIDP_GC_REQINFO 0x4cfa
#define XFPIDP_GC_KICK 0x4cfb
#define XFPIDP_GC_INVITE 0x4cfc
#define XFPIDP_GC_CPERSISTENT 0x4cfd /* should this be renamed? */
#define XFPIDP_GC_CVOICE 0x4cfe
#define XFPIDP_GC_INVITEDENY 0x4cff
#define XFPIDP_GC_VOICEJOIN 0x4d01
#define XFPIDP_GC_VOICELEAVE 0x4d02
#define XFPIDP_GC_VOICEOFF 0x4d04 /* obsolete */
#define XFPIDP_GC_VOICEHOST 0x4d05
#define XFPIDP_GC_QUERY 0x4d06
#define XFPIDP_GC_CDEFLVL 0x4d08
#define XFPIDP_GC_CMOTD 0x4d0c
#define XFPIDP_GC_CVOICEALLOW 0x4d0d /* obsolete */
#define XFPIDP_GC_VOICEJOINSESSION 0x4d11
#define XFPIDP_GC_QNAME 0x4d14
#define XFPIDP_GC_SETPASSWORD 0x4d15
#define XFPIDP_GC_CACCESS 0x4d16
#define XFPIDP_GC_CSILENCE 0x4d17
#define XFPIDP_GC_CJOINPARTMSG 0x4d18

/* XfirePacketID.h client packet ID defines */

#define XFPIDC_LOGIN 0x0001
#define XFPIDC_CLIENTVERSION 0x0003
#define XFPIDC_CLIENTINFO 0x0010
#define XFPIDC_PEERINFO 0x0011

#define XFPIDC_PREFS 0x000a
#define XFPIDC_HEARTBEAT 0x000d

#define XFPIDC_GAMESTATUS 0x0004
#define XFPIDC_FNETWORK 0x0005
#define XFPIDC_FRIENDINVITE 0x0006
#define XFPIDC_ACCEPTINVITE 0x0007
#define XFPIDC_REJECTINVITE 0x0008
#define XFPIDC_DELETEFRIEND 0x0009
#define XFPIDC_FRIENDSEARCH 0x000c
#define XFPIDC_CHANGENICK 0x000e
#define XFPIDC_VOICESTATUS 0x000f /* confirm this */
#define XFPIDC_GROUPCREATE 0x001a
#define XFPIDC_GROUPDELETE 0x001b
#define XFPIDC_GROUPRENAME 0x001c
#define XFPIDC_ADDTOGROUP 0x001d
#define XFPIDC_REMOVEFROMGROUP 0x001e
#define XFPIDC_TEXTSTATUS 0x0020
#define XFPIDC_GAMEINFO 0x0023
#define XFPIDC_ADVINFOREQUEST 0x0025

#define XFPIDC_IM 0x0002
#define XFPIDC_IM_IM (XFPIDP_IM_IM << 16) | XFPIDC_IM
#define XFPIDC_IM_ACK (XFPIDP_IM_ACK << 16) | XFPIDC_IM
#define XFPIDC_IM_P2P (XFPIDP_IM_P2P << 16) | XFPIDC_IM
#define XFPIDC_IM_TYPING (XFPIDP_IM_TYPING << 16) | XFPIDC_IM

#define XFPIDC_DLPEER 0x0017
#define XFPIDC_DLPEER_INFO (XFPIDP_DLPEER_INFO << 16) | XFPIDC_DLPEER
#define XFPIDC_DLPEER_FILES (XFPIDP_DLPEER_FILES << 16) | XFPIDC_DLPEER
#define XFPIDC_DLPEER_STATUS (XFPIDP_DLPEER_STATUS << 16) | XFPIDC_DLPEER
#define XFPIDC_DLFILES 0x0018

#define XFPIDC_GC 0x0019
#define XFPIDC_GC_JOIN (XFPIDP_GC_JOIN << 16) | XFPIDC_GC
#define XFPIDC_GC_LEAVE (XFPIDP_GC_LEAVE << 16) | XFPIDC_GC
#define XFPIDC_GC_MESSAGE (XFPIDP_GC_MESSAGE << 16) | XFPIDC_GC
/*#define XFPIDC_GC_UPDATE (XFPIDP_GC_UPDATE << 16) | XFPIDC_GC*/
#define XFPIDC_GC_CNAME (XFPIDP_GC_CNAME << 16) | XFPIDC_GC
#define XFPIDC_GC_CLVL (XFPIDP_GC_CLVL << 16) | XFPIDC_GC
#define XFPIDC_GC_REQINFO (XFPIDP_GC_REQINFO << 16) | XFPIDC_GC
#define XFPIDC_GC_KICK (XFPIDP_GC_KICK << 16) | XFPIDC_GC
#define XFPIDC_GC_INVITE (XFPIDP_GC_INVITE << 16) | XFPIDC_GC
#define XFPIDC_GC_CPERSISTENT (XFPIDP_GC_CPERSISTENT << 16) | XFPIDC_GC /* rename? */
#define XFPIDC_GC_CVOICE (XFPIDP_GC_CVOICE << 16) | XFPIDC_GC
#define XFPIDC_GC_INVITEDENY (XFPIDP_GC_INVITEDENY << 16) | XFPIDC_GC
#define XFPIDC_GC_VOICEJOIN (XFPIDP_GC_VOICEJOIN << 16) | XFPIDC_GC
#define XFPIDC_GC_VOICELEAVE (XFPIDP_GC_VOICELEAVE << 16) | XFPIDC_GC
#define XFPIDC_GC_VOICEOFF (XFPIDP_GC_VOICEOFF << 16) | XFPIDC_GC /* obsolete */
#define XFPIDC_GC_VOICEHOST (XFPIDP_GC_VOICEHOST << 16) | XFPIDC_GC
#define XFPIDC_GC_QUERY (XFPIDP_GC_QUERY << 16) | XFPIDC_GC
#define XFPIDC_GC_CDEFLVL (XFPIDP_GC_CDEFLVL << 16) | XFPIDC_GC
#define XFPIDC_GC_CMOTD (XFPIDP_GC_CMOTD << 16) | XFPIDC_GC
#define XFPIDC_GC_CVOICEALLOW (XFPIDP_GC_CVOICEALLOW << 16) | XFPIDC_GC /* obsolete */
#define XFPIDC_GC_VOICEJOINSESSION (XFPIDP_GC_VOICEJOINSESSION << 16) | XFPIDC_GC
#define XFPIDC_GC_QNAME (XFPIDP_GC_QNAME << 16) | XFPIDC_GC
#define XFPIDC_GC_SETPASSWORD (XFPIDP_GC_SETPASSWORD << 16) | XFPIDC_GC
#define XFPIDC_GC_CACCESS (XFPIDP_GC_CACCESS << 16) | XFPIDC_GC
#define XFPIDC_GC_CSILENCE (XFPIDP_GC_CSILENCE << 16) | XFPIDC_GC
#define XFPIDC_GC_CJOINPARTMSG (XFPIDP_GC_CJOINPARTMSG << 16) | XFPIDC_GC

#define XFPIDC_ADDFAV 0x0013
#define XFPIDC_DELFAV 0x0014
#define XFPIDC_FRIENDFAV 0x0015
#define XFPIDC_SERVERS 0x0016

#define XFPIDC_LIVELIDEO 0x0026

/* XfirePacketID.h server packet ID defines */

#define XFPIDS_LOGINSALT 0x0080
#define XFPIDS_INVALIDLOGIN 0x0081
#define XFPIDS_CLIENTINFO 0x0082
#define XFPIDS_WRONGVERSION 0x0086
#define XFPIDS_PREFS 0x008d
#define XFPIDS_GROUPS 0x0097
#define XFPIDS_INGROUPS 0x0098
#define XFPIDS_MYSCREENSHOTS 0x009d
#define XFPIDS_CONNECTIP 0x00af

#define XFPIDS_HEARTBEAT 0x0090

#define XFPIDS_FRIENDS 0x0083
#define XFPIDS_ONLINESTATUS 0x0084
#define XFPIDS_GAMESTATUS 0x0087
#define XFPIDS_FNETWORK 0x0088
#define XFPIDS_INVITESTATUS 0x0089
#define XFPIDS_FRIENDINVITE 0x008a
#define XFPIDS_DELETEFRIEND 0x008b
#define XFPIDS_FRIENDSEARCH 0x008f
#define XFPIDS_VOICESTATUS 0x0093
#define XFPIDS_GROUPCREATE 0x0099
#define XFPIDS_TEXTSTATUS 0x009a
#define XFPIDS_GAMEINFO 0x009c
#define XFPIDS_CHANGENICK 0x00a1
#define XFPIDS_SCREENSHOTS 0x00ac
#define XFPIDS_ADVINFOUPDATE 0x00ad
#define XFPIDS_AVATAR 0x00ae
#define XFPIDS_CLANS 0x00b0
#define XFPIDS_VIDEOS 0x00b6
#define XFPIDS_EGAME 0x00b7

#define XFPIDS_IM 0x0085
#define XFPIDS_IM_IM (XFPIDP_IM_IM << 16) | XFPIDS_IM
#define XFPIDS_IM_ACK (XFPIDP_IM_ACK << 16) | XFPIDS_IM
#define XFPIDS_IM_P2P (XFPIDP_IM_P2P << 16) | XFPIDS_IM
#define XFPIDS_IM_TYPING (XFPIDP_IM_TYPING << 16) | XFPIDS_IM
#define XFPIDS_BROADCAST 0x00a9

#define XFPIDS_PEERINFO 0x0190
#define XFPIDS_PEERINFO_OTHER 0x0191
#define XFPIDS_NEWCHANNEL 0x01c2

#define XFPIDS_MYCLANS 0x009e
#define XFPIDS_CLANMEMBERS 0x009f
#define XFPIDS_LEFTCLAN 0x00a0
#define XFPIDS_CLANNICK 0x00a2
#define XFPIDS_CLANORDER 0x00a3 /* NO! All groups in friends list, including Friends Online (and Offline, FoF?)! */
#define XFPIDS_CLANINVITE 0x00a5
#define XFPIDS_CLANEVENTS 0x00aa
#define XFPIDS_CLANEVENTDELETED 0x00ab
#define XFPIDS_CLANNEWS 0x00b1

#define XFPIDS_GC_LIST 0x009b
#define XFPIDS_GC_CNAME 0x015e
#define XFPIDS_GC_JOININFO 0x015f
#define XFPIDS_GC_JOIN 0x0161
#define XFPIDS_GC_LEAVE 0x0162
#define XFPIDS_GC_MESSAGE 0x0163
#define XFPIDS_GC_INVITE 0x0164
#define XFPIDS_GC_CLVL 0x0165
#define XFPIDS_GC_REQINFO 0x0166
#define XFPIDS_GC_KICK 0x0167
#define XFPIDS_GC_VOICESTATUS 0x0168
#define XFPIDS_GC_VOICEHOSTINFO 0x016b
#define XFPIDS_GC_VOICELEAVE 0x016d
#define XFPIDS_GC_VOICEJOIN 0x016f
#define XFPIDS_GC_ROOMINFO 0x0170
#define XFPIDS_GC_CDEFLVL 0x0172
#define XFPIDS_GC_CMOTD 0x0176
#define XFPIDS_GC_CALLOWVOICE 0x0177
#define XFPIDS_GC_VOICESESSION 0x017f
#define XFPIDS_GC_QNAME 0x0180
#define XFPIDS_GC_CPASSWORD 0x0181
#define XFPIDS_GC_CACCESS 0x0182
#define XFPIDS_GC_INVITEDENY 0x0183
#define XFPIDS_GC_CSILENCE 0x0184
#define XFPIDS_GC_CJOINPARTMSG 0x0185

#define XFPIDS_FAVORITES 0x0094
#define XFPIDS_FRIENDFAV 0x0095
#define XFPIDS_SERVERS 0x0096

#define XFPIDS_MYVIDEOS 0x00b3
#define XFPIDS_LIVEVIDEO 0x00b8

#endif
